<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
	    <base href="<%=basePath%>">
		<title>会员兑换记录</title>
	    <%@include file="../collect/meta.jsp"%>
	    <link rel="stylesheet" href="css/radius.css" type="text/css"></link>
	    <script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
	</head>
	<body lang="zh-cn">
		<div class="wrapper">	
	       <c:import url="/collect/top.jsp"></c:import>
			<div class="main-container" id="main-container">
				<div class="main-container-inner">
					<c:import url="/collect/left.jsp"></c:import>
					<div class="main-content">
						<div class="breadcrumbs" id="breadcrumbs">
							<ul class="breadcrumb">
								<li><i class="icon-home home-icon"></i>商品兑换</li>
								<li>兑换记录</li>
							</ul><!-- .breadcrumb -->
						</div>
						<div class="page-content">
							<div class="row">
								<div class="col-xs-12">
									<form action="exchangegood!watchExLogByTel" name="seekoneMember" method="post">
										<table id="table_bug_report" class="table table-striped table-bordered table-hover">
											<tr>
												<td>
													<input type="text"  style="height: 30px;font-size: 16px;width: 160px" name="member.mobile" id="mobile" placeholder="手机号" />&nbsp;&nbsp;
												    <input type="button" class="btn btn-primary radius btn-sm" value="搜索" id="oneMemberBtn">
												    <a class="btn btn-primary radius btn-sm" href="exchangegood!watchExLog">查询全部</a>
												</td>
											</tr>
										</table>
									</form>
									<table id="table_bug_report" class="table table-striped table-bordered table-hover">
										 <tr>
										   <td width="17%" height="25"><div align="center">会员手机号</div></td>
										   <td width="17%"><div align="center">姓名</div></td>
										   <td width="17%"><div align="center">商品名称</div></td>
										   <td width="16%"><div align="center">店铺名称</div></td>
										   <td width="23%"><div align="center">兑换时间</div></td>
										 </tr>
										 <c:forEach items="${exchangeLogs}" var="exchangeLog" varStatus="status">
									     <tr <c:if test="${status.count%2==0}">bgcolor="#d8e7f0"</c:if> <c:if test="${status.count%2!=0}">bgcolor="#ffffff"</c:if>>
											<td height="25"><div align="center">${exchangeLog.member.mobile}</div></td>
											<td><div align="center">
												<c:choose>
											<c:when test="${not empty exchangeLog.member.name}">
											${exchangeLog.member.name }
											</c:when>
											<c:otherwise>
											</c:otherwise>
											</c:choose>
											</div></td>
											<td><div align="center">${exchangeLog.exchangeGood.goodname }</div></td>
											<td><div align="center">${exchangeLog.shop.name}</div></td>
											<td><div align="center">${exchangeLog.createTime }</div></td>
										</tr>
									</c:forEach>
										</table>			
									<table width="100%" border="0">
	          <tr bgcolor="#fff0f0">
	            <td width="19%">&nbsp;</td>
	            <td width="13%"><div align="center"><a href="exchangegood!watchExLogByTel?index=1&member.mobile=${mobile }">第一页</a></div></td>
	            <td width="13%"><div align="center"><a href="exchangegood!watchExLogByTel?index=${index-1}&member.mobile=${mobile }">上一页</a></div></td>
	            <td width="10%"><div align="center">${index }</div></td>
	            <td width="13%"><div align="center"><a href="exchangegood!watchExLogByTel?index=${index+1 }&member.mobile=${mobile }">下一页</a></div></td>
	            <td width="13%"><div align="center"><a href="exchangegood!watchExLogByTel?index=${page }&member.mobile=${mobile }">最末页</a></div></td>
	            <td width="19%">&nbsp;</td>
	          </tr>
	        </table>
								</div><!-- /.col -->
							</div><!-- /.row -->
						</div><!-- /.page-content -->
					</div><!-- /.main-content -->
				</div><!-- /.main-container-inner -->
				<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse" style="position:fixed;bottom:0;">
					<i class="icon-double-angle-up icon-only bigger-110"></i>
				</a>
			</div><!-- /.main-container -->
			<div class="push"></div>
	     </div>
	     <c:import url="/collect/down.jsp"></c:import>
	  </body>
	<script type="text/javascript">
  	$(document).ready(function(){
  		$("#oneMemberBtn").click(function(){
  			var mobile = $("#mobile").val();
  			if (mobile.length != 0) {
  				$("form[name='seekoneMember']").submit();
			}
  		});
  		//防收回；兑换管理:$兑换记录
		$('.goodsexchange > ul').show();
		$('.goodsexchange > ul > li > a').eq(1).css("color","red");
  	});
  </script>
</html>
